from sqlalchemy import Column, Integer, String, Date, DateTime

from model.sqlConnect import Base, SqliteSqlalchemy


class SalesRecord(Base):
    # 定义表名
    __tablename__ = 'SALES_RECORD'
    # 定义字段
    id_sales_record = Column(Integer, autoincrement="auto", primary_key=True)
    id_dict = Column(Integer)
    id_board_game_table = Column(Integer)
    id_goods = Column(Integer)
    pay_time = Column(Integer)
    is_deleted = Column(String(2), default="N")
    create_at = Column(DateTime)
    update_at = Column(DateTime)


def queryAll():
    session = SqliteSqlalchemy().session
    result = session.query(SalesRecord.id_dict).all()
    session.close()
    return result
